package com.csw.tourismInformation.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import com.csw.tourismInformation.dao.UserDao;
import com.csw.tourismInformation.entity.User;

/**
 * Created by Administrator on 2019/10/22.
 */
@Service
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
public class UserServiceImpl implements UserService {
	@Autowired
	private UserDao userDao;

	@Transactional(rollbackFor = Exception.class)
	@Override
	public User findUsernameAndPassword(String username, String password) {

		return userDao.queryUsernameAndPassword(username, password);
	}

	@Override
	public void add(User user2) {
		userDao.add(user2);
	}

}
